package com.example.demo;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

import javax.servlet.MultipartConfigElement;
import java.io.IOException;
@EnableScheduling
@ServletComponentScan("com.example.demo.controller")
@SpringBootApplication
@EnableAsync
@MapperScan("com.example.demo.dao")
	public class DemoApplication {

		public static void main(String[] args) throws IOException {

			SpringApplication springApplication = new SpringApplication(DemoApplication .class);

			springApplication.run(args);
/*		NettyServer nettyServer = new NettyServer();
		nettyServer.start(new InetSocketAddress("192.168.31.23", 8862));//172.16.102.164*/

		}

	@Bean
	public MultipartConfigElement multipartConfigElement(){
		MultipartConfigFactory factory = new MultipartConfigFactory();
		factory.setMaxFileSize("1024000KB");
		return factory.createMultipartConfig();
	}



}
